/**
 * @Title: EngineerMapper.java
 * @Package com.zhangsan.senior1.week3.dao
 * @Description: (描述该文件做什么)
 * @author Alex Lu
 * @date 2019年9月12日 上午8:39:44
 * @version V1.0
 */
package com.alex.senior1.week3.dao;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.alex.senior1.week3.domain.InvestInfo;
import com.alex.senior1.week3.vo.InvestVo;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;

/**
 * @ClassName: EngineerMapper
 * @Description: (描述这个类的作用)
 * @author Alex Lu
 * @date 2019年9月12日 上午8:39:44
 *
 */
public interface InvestInfoMapper extends BaseMapper<InvestInfo> {
	@Select("SELECT r.id as id,r.name as name,r.gender as gender,r.province as province,r.company as company,r.my_profession as myProfession,p.name as regProfessionName1,a.name as regProfessionName2,r.cert_no as certNo,r.register_num as registerNum,r.validate_period as validatePeriod FROM (SELECT id, NAME FROM t_profession ) AS p RIGHT JOIN t_engineer r ON p.id = r.reg_profession1 LEFT JOIN t_profession a ON a.id = r.reg_profession2 ${ew.customSqlSegment}")
	public IPage<InvestVo> selectAllEngineerByPage(IPage<InvestVo> page, @Param(Constants.WRAPPER) Wrapper<InvestVo> queryWrapper);

	@Select("SELECT r.id as id,r.name as name,r.gender as gender,r.province as province,r.company as company,r.my_profession as myProfession,p.name as regProfessionName1,a.name as regProfessionName2,r.cert_no as certNo,r.register_num as registerNum,r.validate_period as validatePeriod FROM (SELECT id, NAME FROM t_profession ) AS p RIGHT JOIN t_engineer r ON p.id = r.reg_profession1 LEFT JOIN t_profession a ON a.id = r.reg_profession2 ${ew.customSqlSegment}")
	public InvestVo getOneEngieer(@Param(Constants.WRAPPER) Wrapper<InvestVo> queryWrapper);
}
